package com.google.samples.apps.library_common.utils

import android.text.TextUtils
import android.util.Log
import okhttp3.logging.HttpLoggingInterceptor
import java.net.URLDecoder

class MyHttpLoggingInterceptor : HttpLoggingInterceptor.Logger {
    override fun log(message: String?) {
        if (LogUtils.debug) {
            var msg: String? = message
            if (!TextUtils.isEmpty(message) && message!!.startsWith("mapStr")) {
                msg = URLDecoder.decode(message!!, "UTF-8")
            }
            LogUtils.d("${LogUtils.TAG}_OKHTTP", msg)
        }
    }

}